package hbec.kettle.etl.engine.plugin;

import java.util.concurrent.LinkedBlockingQueue;

public class LineExchanger {
	
	public static LinkedBlockingQueue<Line> queue = new LinkedBlockingQueue<>(100);
	
	public static synchronized Line createLine() {
		return new Line();
	}

	public static synchronized Line getFromReader() {
		return queue.peek();
	}

	public static synchronized boolean sendToWriter(Line line) {
		return queue.offer(line);
	}

	public static synchronized boolean popLine(Line line) {
		return queue.remove(line);
	}

}
